This page last changed on Oct 24, 2006 by cholmes.


Refactoring is the process of restructuring/renaming your code to ensure your design remains clean as your requirements and functionality change and grow with time.

Refactoring is best explored using the excellent book writen my Martin Fowler.

We are fans of refactoring in the GeoServer Project, we like to start with the minimal design and refactor when needed, instead of trying to anticipate everything in advance. If you've started a class that spirals out of control and could be better designed, then have a go at refactoring. Just be sure it passes all the tests.

Subversion Warning

SVN wants to know what you are doing, please use the svn mv name1 name2 command
when refactoring to let svn keep track of history information.

This is especially important when using either of the tools below - although we can hope that
more complete svn intergration is available for Eclipse shortly.

This is of utmost importance when refactoring, so no history is lost.

RefactorIt

To ease refactoring you can use RefactorIt which provides tools to:

  • research, probe and understand existing source code,
  • move, organise and transform existing code,
  • and provide code metrics.

More details can be found from the online help.

RefactorIt is commercial, but provides free licences for Open Source projects like Geotools. See the RefactorIt web pages for details. It can be plugged into a variety of IDEs, including Netbeans.

Installation in to GEOTOOLS:Netbeans fairly strait forward through Tools -> RefactorIt -> Project Options, although setting up soucepath and classpath is a difficult if some of the geotools files don't compile. You will need to either remove the offending files, get them to compile or remove them from RefactorIt's sourcepath.

Eclipse Refactoring

Eclipse has many refactorings available, mostly through context menus.

Document generated by Confluence on Jan 16, 2008 23:26